﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JXT.PrimaryKey.Batman.Core.OAuth
{
    /// <summary>
    /// HTTP访问封装接口
    /// </summary>
    public interface IHttpClient
    {
        /// <summary>
        /// 使用GET的方式访问URL
        /// </summary>
        /// <param name="uri">url</param>
        /// <param name="headers">http头部信息</param>
        /// <returns>服务器返回字符串</returns>
        string GetRequest(Uri uri, IDictionary<string, string> headers = null);

        /// <summary>
        /// 使用POST的方式访问UR
        /// </summary>
        /// <param name="uri">url</param>
        /// <param name="data">提交数据</param>
        /// <param name="headers">http头信息</param>
        /// <returns>服务器返回字符串</returns>
        string PostRequest(Uri uri, string data, IDictionary<string, string> headers = null);
    }
}
